package my.jieh.tips.math;

/**
 * <p>Title: Core Java Technologies Tech Tips</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2002</p>
 * <p>Company: Blueimp</p>
 * @author jieh
 * @version 1.0
 */
import java.math.BigInteger;
import java.util.Random;

public class PrimeDemo2 {
	public static void main(String args[]) {
		Random rnd = new Random(0);

		// obtain a 100-bit probable prime,
		// with the probability that the number
		// is composite at less than
		// 1 in 2 to the 100th power
// jdk 1.4
		BigInteger prime = BigInteger.probablePrime(100, rnd);

		System.out.println(prime);
		Double Obj1 = new Double(2.43);
		Double Obj2 = new Double(2.43);
		Double Obj3 = Obj1;
		System.out.println("These objects are equal: ");
		System.out.println(Obj1 == Obj2);
		System.out.println(Obj1 == Obj3);
		System.out.println(Obj1.equals(Obj2));
	}
}
